package com.student.service;

import com.student.model.StudentDAO;
import com.student.model.TeacherDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private StudentDAO studentDAO;

    @Autowired
    private TeacherDAO teacherDAO;

    //学生密码验证
    public boolean checkStudentPassword(String serialNumber,String password){
        return studentDAO.existsBySerialNumberAndPassword(serialNumber,password);//封装了一个检查学号和密码的方法
    }

    //教师密码验证
    public boolean checkTeacherPassword(String phone,String password){
        return teacherDAO.existsByPhoneAndPassword(phone,password);//封装了一个检查教工和密码的方法
    }
}
